/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package digitaldreamers.games.papermonsters.clients.gameclient.network.packets.receiving;

import digitaldreamers.libraries.games.clients.networkmanagement.packets.receiving.AbReceivablePacket;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;

/**
 *
 * @author DaoLe
 */
public class RLoginRequestResponse extends AbReceivablePacket {
    
    private boolean m_bLoginStatus;
    private String m_strUsername;
    private String m_strEmail;
    private String m_strFirstName;
    private String m_strLastName;
    private String m_strPhone;
    private boolean m_bGender;
    private int m_iExperience;
    private int m_iCoin;
    private int m_iCash;
    private int m_iStamina;
    private int m_iWin;
    private int m_iLoss;
    
    public boolean getLoginStatus() {
        return m_bLoginStatus;
    }
    
    public String getUsername() {
        return m_strUsername;
    }
    
    public String getEmail() {
        return m_strEmail;
    }
    
    public String getFirstName() {
        return m_strFirstName;
    }
    
    public String getLastName() {
        return m_strLastName;
    }
    
    public String getPhone() {
        return m_strPhone;
    }
    
    public boolean getGender() {
        return m_bGender;
    }
    
    public int getExperience() {
        return m_iExperience;
    }
    
    public int getCoin() {
        return m_iCoin;
    }
    
    public int getCash() {
        return m_iCash;
    }
    
    public int getStamina() {
        return m_iStamina;
    }
    
    public int getWin() {
        return m_iWin;
    }
    
    public int getLoss() {
        return m_iLoss;
    }
    
    @Override
    public void fromByteArray(byte[] arr_byData) throws Exception {
        // TODO Auto-generated method stub
        ByteArrayInputStream BAIS = new ByteArrayInputStream(arr_byData);
        DataInputStream DIS = new DataInputStream(BAIS);
        m_iPacketID = DIS.readInt();
        m_bLoginStatus = DIS.readBoolean();
        if (m_bLoginStatus) {
            m_strUsername = DIS.readUTF();
            m_strEmail = DIS.readUTF();
            m_strFirstName = DIS.readUTF();
            m_strLastName = DIS.readUTF();
            m_strPhone = DIS.readUTF();
            m_bGender = DIS.readBoolean();
            m_iExperience = DIS.readInt();
            m_iCoin = DIS.readInt();
            m_iCash = DIS.readInt();
            m_iStamina = DIS.readInt();
            m_iWin = DIS.readInt();
            m_iLoss = DIS.readInt();
        }
    }
}
